/*
 *  main.cpp
 *  EidoTron
 *
 *  Created by Luca Di Franco on 07/03/11.
 *  Copyright 2011 Luca Di Franco. All rights reserved.
 *
 */

#include <string>
#include "Core/EidoTronApp.h"

using std::string;

int main(int argc, char* argv[])
{	
	#ifdef __APPLE__
	{
		string defaultWorkdir = string(argv[0]);
		size_t appPathEnd = defaultWorkdir.rfind("/EidoTron.app/");
		if (appPathEnd != string::npos)
		{
			string desiredWorkdir = defaultWorkdir.substr(0, appPathEnd);
			desiredWorkdir.append("/EidoTron.app/Contents/Resources/");
			chdir(desiredWorkdir.c_str());
		}
	}
	#endif
	EidoTronApp eidoTron;
	return eidoTron.execute();
}